
function BlogReadItem($scope, $http, BlogGetThreadInfo) {

	// JQUERY UPLOAD STUFF
	console.log ("BlogReadItem")
    $scope.isAttachFilePanellHidden = true;

        

    // CODE MIRROR STUFF
	$scope.editorOptions = {
        lineWrapping : true,
        lineNumbers: true,
        readOnly: 'nocursor',
        mode: 'xml',
    };

    $scope.clearCode = function(){
		$scope.threadInfo.thread.code = ''
	}
	

    $scope.reParseInput = function(){
	  /*  $scope.errorMsg = "";
	    $timeout.cancel(pending);
	    pending = $timeout($scope.workHere, 500);*/
	};





    // Get thread info
	BlogGetThreadInfo.get( { },  function(data) {
	     if (data.result.status == "ok")
	     {
	      $scope.threadInfo = data;
	      console.log ("1222::>", $scope.threadInfo)
	      
	      $scope.tags = data.tags;
	      $scope.selectedTag =  $scope.tags[0]

	      $scope.usersToNotify = data.users;

	      $scope.comments = data.comments;

	  /*    $scope.tinymce =  data.thread.msg;*/
	    //  $scope.todos[catIndex].opened.splice(todoIndex, 1)
	     }
    });

	
	$scope.save  = function(){
		console.log ("save")
	}


}

BlogReadItem.$inject = ['$scope', '$http', 'BlogGetThreadInfo'];




